<%@page import="java.util.Iterator"%>
<%@page import="info.Shop"%>
<%@page import="java.util.List"%>
<%@page import="info.ShopDbBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%
ShopDbBean bean = new ShopDbBean();
List<Shop> data = bean.getAll();

out.println("[");

String countStr = String.format("共有:%d条记录", data.size());
System.out.println(countStr);
Iterator<Shop> iter = data.iterator();
while(iter.hasNext()) {
	Shop info = iter.next();
	out.println("{");
	
	out.println("\"id\":\"" + info.getId() + "\"");
    
    out.println(", \"name\":\"" + info.getName() + "\"");
    
    out.println(", \"imageURL\":\"" + info.getImageURL() + "\"");
    
    out.println(", \"score\":\"" + info.getScore() + "\"");
    
    out.println(", \"sale\":\"" + info.getSale() + "\"");
    
    out.println(", \"sprice\":\"" + info.getSprice() + "\"");
    
    out.println(", \"dprice\":\"" + info.getDprice() + "\"");
    
    out.println(", \"distance\":\"" + info.getDistance() + "\"");
    
    out.println(", \"time\":\"" + info.getTime() + "\"");
    
	out.println("}");
	if(iter.hasNext()){
		out.println(", ");
	}
	
}


out.println("]");
%>
